import { createRouter, createWebHistory } from "vue-router";
import Child from "../components/Child.vue";
import HelloWorld from "../components/HelloWorld.vue";

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      redirect: "/child",
    },
    {
      path: "/child/:id?",
      component: Child,
    },
    {
      path: "/child2",
      component: Child,
    },
    {
      path: "/hello",
      component: HelloWorld,
    },
  ],
});

export default router;
